package com.lfx.concurrent.daemon;

/**
 * @author 李逢喜
 * create 2021/7/23
 */
public class MyThread2 extends Thread{

    private boolean running=true;


    @Override
    public void run() {
        while (running){
            System.out.println("线程正在运行");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public  void stopRunning(){
        running=false;
    }


}
